package ro.dandanciu.webgallery.ui.exceptions;

import java.util.Arrays;

/**
 * Exception which is thrown when an invalid mode was submitted.
 * @author Dan Danciu
 *
 */
public class UnknownSubmitModeException extends Exception {

    /**
     * The serialVersionUID.
     */
    private static final long serialVersionUID = -7315171095180923219L;

    /**
     * Create an exception for an unknown mode submission.
     * @param mode the mode which was submitted.
     * @param allowdedModes the modes which are known to the action.
     */
    public UnknownSubmitModeException(final String mode, final String[] allowdedModes) {
        super("Form was submitted with an unknown mode: " + mode
                + ", alowded modes are: " + Arrays.toString(allowdedModes));
    }

}
